import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from "../views/Main.vue";
import Home from '../views/Home.vue'
import User from '../views/User.vue'
import Mall from "@/views/Mall.vue";
import PageOne from "@/views/PageOne.vue";
import PageTwo from "@/views/PageTwo.vue";
import Login from "@/views/Login.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'main',
    component: Main,
    redirect: "/home",//路由重定向
    children: [
      /* {
        path: "home",
        component: Home,
        name: "home"
      },
      {
        path: "user",
        component: User,
        name: "user"
      },
      {
        path: "mall",
        component: Mall,
        name: "mall"
      },
      {
        path: "page1",
        component: PageOne,
        name: "page1"
      },
      {
        path: "page2",
        component: PageTwo,
        name: "page2"
      }, */
    ]
  },
  {
    path:"/login",
    component:Login,
    name:"login"
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
